<?php
//PingBuWang.Com
//Copyright (c) 2017~2099 http://www.pingbuwang.com All rights reserved.
namespace app\tinyinfo\model;
use think\Cache;
use mip\Paginationm;
use think\Db;
use think\Controller;
use think\Model;

class TinyinfoCode extends Model
{

    public function getPage($where,$order,$page=1,$limit=15 ){
        if(!$page){
            $page = 1;
        }
        if(!$limit){
            $limit = 15;
        }

        $list = db('tinyinfoCode')->where($where)->order($order)->page($page,$limit)->select();
        $cnt =  db('tinyinfoCode')->where($where)->count();
        return array('list'=>$list,'limit'=>$limit,'count'=>$cnt);
    }

    public function getAllList(){
        $codes = db('tinyinfoCode')->select();
        return $codes;
    }

}